import {Entity} from "../../entity";
import {Alias, Column, Editor, Enum, Serialize} from "../../decorator";

//卖单
export class Sell extends Entity {

    @Editor("String")
    @Alias("订单编号")
    @Serialize("code")
    public code: string = "";

    @Editor("Memo")
    @Alias("订单描述")
    @Serialize("description")
    public description: string = "";

    @Editor("Number")
    @Alias("成交价")
    @Serialize("price")
    public price: number = 0;

    @Editor("Number")
    @Alias("数量")
    @Serialize("amount")
    public amount: number = 0;

    @Editor("Date")
    @Alias("日期")
    @Serialize("date")
    public date: Date = new Date();

    @Editor("Memo")
    @Alias("备注")
    @Serialize("person")
    public note: string = "";

    @Serialize("product")
    public product: any = null;

    @Serialize("customer")
    public customer: any = null;

    @Serialize("paid")
    public paid: boolean = false;

    public checked: boolean = false;

    constructor() {
        super();
    }

    fromJSON(obj) {
        super.fromJSON(obj);
    }

    toJSON(): any {
        return super.toJSON();
    }

}


